﻿using System;
using System.Linq;
using LandingPagesStats.Models;
using System.Data.Entity.ModelConfiguration;

namespace LandingPagesStats.Data.Mappings
{
    public class HostMap : EntityTypeConfiguration<Host>
    {
        public HostMap()
        {
            this.HasKey(x => x.HostId);

            this.Property(x => x.Url)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(x => x.Count)
                .IsRequired();

            this.Property(x => x.LastEntry)
                .IsOptional();
        }
    }
}
